package top.dingwen.io.treasure.sensitive.param;

import io.github.linpeilie.annotations.AutoMapper;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import top.dingwen.io.treasure.base.param.BaseParam;
import top.dingwen.io.treasure.enums.validator.annotation.EnumValues;
import top.dingwen.io.treasure.sensitive.constant.WordsType;
import top.dingwen.io.treasure.sensitive.po.SensitiveWords;
import top.dingwen.io.treasure.webplus.core.validator.valid.ValidGroup;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 敏感词入参对象
 *
 * @author dingwen
 * @since 2024/11/21 17:26
 */
@Getter
@Setter
@AutoMapper(target = SensitiveWords.class)
public class WordsParam extends BaseParam {

    /**
     * 敏感词编号
     */
    @NotNull(message = "请正确填写敏感词编号", groups = {ValidGroup.Modify.class})
    private Long id;

    /**
     * 敏感词内容
     */
    @NotBlank(message = "请正确填写敏感词内容")
    @Length(max = 30, message = "敏感词内容长度不能超过30")
    private String wordsContent;

    /**
     * 敏感词类型
     * <p>
     *     <ul>
     *         <li>B:黑名单</li>
     *         <li>W:白名单</li>
     *     </ul>
     * </p>
     */
    @EnumValues(enumClass = WordsType.class, message = "请指明敏感词类型")
    private WordsType wordsType;
}
